<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<base-checkbox v-model="lovingVue"></base-checkbox>
		</div>
	</body>
	<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		
		Vue.component('base-checkbox', {
		  model: {
		    prop: 'checked',
		    event: 'change'
		  },
		  props: {
		    checked: Boolean
		  },
		  
		  created() {
		  	console.log(this.$listeners);
		  },
		  template: `
		    <input
		      type="checkbox"
		      v-bind:checked="checked"
		      v-on:change="$emit('change', $event.target.checked)"
		    >
		  `
		})
		const vm = new Vue({
			el: '#app',
			data:{
				lovingVue:true,
			},
			created() {
				console.log(this.$listeners);
			}
		})	
	</script>
</html>
